package com.zhuang.principle.inversion;

/**
 * @Classname DependenceInversion2
 * @Description 用一句话描述类的作用
 * @Date 2021/3/15 13:27
 * @Created by dell
 */

public class DependenceInversion2 {
    public static void main(String[] args) {
        Client client = new Client();
        client.receive(new Emailiml());
        client.receive(new WXimpl());
    }
}

interface IReceive{
    public void printInfo(Integer uid);
}

class WXimpl implements IReceive {
    @Override
    public void printInfo(Integer uid) {
        System.out.println("发送微信消息"+uid);
    }
}

class Emailiml implements IReceive {
    @Override
    public void printInfo(Integer uid) {
        System.out.println("发送邮件信息"+uid);
    }
}
class Client{
    public void receive(IReceive receive){
        receive.printInfo(12345);
    }
}

